package cc.linker.steplink.crm.dao;

import cc.linker.steplink.crm.domain.AuthorTask;
import cc.linker.steplink.crm.domain.Precise;
import cc.linker.steplink.crm.merchant.pojo.PersonGroupDTO;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface PreciseDao {
    List<Map<String, Object>> listPrecise(Map<String, Object> map);

    List<Map<String, Object>> listPreciseWithGroupName(Map<String, Object> map);

    int deleteByPrimaryKey(String taskId);

    int addPrecise(Precise precise);

    int updateByPrimaryKeySelective(Precise precise);

    Map<String, Object> getPrecise(String taskId);

    List<Map<String, Object>> getToBePushedList();

    List<Map<String, Object>> getWxToBePushedList();

    int changeStatus(Map map);

    int delGroup(String id);

    boolean addWxPrecise(Map param);

    boolean updateWxPush(Map param);

    Map<String, Object> getInfo(String taskId);

    Integer getTaskCountByName(@Param(value = "taskName") String taskName, @Param(value = "taskId") String taskId,@Param("orgId") String orgId);

    Map<String, Object> getSendReport(String taskId);

    //【千人计划】 根据TaskId 获取千人演示计划 demo list
    List<Map<String, Object>> getDemoSendListByTaskID(String taskId);

    //【千人计划】 查询推送报告
    List<Map<String, Object>> getPushReport(String taskId);

    //【千人计划】查询阅读趋势
    List<Map<String, Object>> getReadTrendReport(String taskId);

    //【千人计划】创建分组
    void createGroup(PersonGroupDTO groupDTO);

    /**
     * 【千人计划】获取auth人员列表
     *  @parmas 筛选条件
     * */
    List<Map<String, Object>> getAuthList(Map<String,Object> params);

    //【千人计划】获取任务列表
    List<AuthorTask> getTaskList();

    //【千人计划】获取任务id与发送成功数量的关系
    List<Map<String, Object>> taskIdAndSuccessSendMap ();

    //【千人计划】添加分组与人员的绑定关系(批量插入)
    void addPersonGroupBindBatch(List<Map<String,Object>> list);

    List<Map<String, Object>> getGroupList();

    //【千人计划】根据分组查询email(多个情况)
    List<String> getEmailListByGroupIds(String[] list);


    //【千人计划】根据分组查询email(单个)
    List<String> getEmailListByGroupId(String list);

    //【千人计划】根据分组查询用户id
    List<String> getIdsListByGroupIds(List<String> list);

    //【千人计划】添加至任务表
    void addPreciseDemoTask(AuthorTask authorTask);

    //【千人计划】获取任务分组拼接名称
    String getPreciseDemoGroupNameByIds(String groupId);

    Map<String,Object>getTaskInfo(String taskId);


    String getTokenByOrgId(String orgId);

    List<String> getOpenIdsByCustomerIdsAndToken(@Param("customerId") String customerId, @Param("token") String token);

    void updateWxTouchByTaskId(Map<String, Object> map);

    List<Map<String, Object>> getGroupListByIds(String groupId);

    String getCustomerPhonesByCustomerIds(String customerIds);

    String getCustomerIdsByCustomerPhones(String customerPhones);

    String getGroupNameByIds(String groupId);

    void changeStatusByList(List<String> taskIdList);

}
